package com.oop;

class Father{
    public String name = "baba";

    public void eat(){
        System.out.println("爸爸在吃东西");
    }
}

class Son extends Father{
    public String name = "儿子";

    public void eat(){
        System.out.println("儿子在吃东西");
    }
}



public class test01_duotai {

    public static void main(String[] args) {
        //多态
        Father p1 = new Son();
        p1.eat();
        System.out.println(p1.name);


    }


}